#include <MCP23X08.h>
#include <LiquidCrystal.h>
#include <Wire.h>
#include <Spi.h>
#include <MCP2510.h>  // The CAN interface device
#include <Canutil.h> 

class Communication
{
private:
   MCP2510*  can_dev;
   Canutil*  canutil;
   uint16_t filter[6];
   uint8_t data[8];
   uint8_t opmode;
   uint8_t tosend[8];
   int flagReceivedData;
   uint8_t txstatus;
public:
  Communication();
  Communication(MCP2510 can_dev, Canutil canutil);
  void setFilter(uint16_t filter,int id);
  void sendData(uint8_t data[8],uint16_t id, uint8_t priority);
  void received();
  uint8_t* getData();
  int getFlagReceivedData();
protected:
  void finalizeFilter();
  
};